<%@page import="DTO.UsuarioDTO"%>
<%@page contentType="text/html" pageEncoding="UTF-8" language="java" session="true"%>
<!DOCTYPE html>

<%
	UsuarioDTO usuarioDTO = (UsuarioDTO) session.getAttribute("usuarioDTO");
%>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Cadastro: Usuario</title>
		<link rel="stylesheet" type="text/css" href="../../livros/styles/styles.css" />
		<script type="text/javascript" src="../../livros/js/view.js"></script>
		<script type="text/javascript" src="../../livros/js/validacao.js"></script>
	</head>
	<body>
	<jsp:include page="../include/header.jsp"></jsp:include>

	<div id="conteudo">
		<div id="conteudoPagina">
			<h1>Cadastro de Usuario</h1>
			<span class="warningsSpam"> 
				<h4 class="camposObrigatorios">* = Campos Obrigatórios</h4>			
				<% 				
		 		if (session.getAttribute("erro") != null) {
			 		out.println(session.getAttribute("erro"));
			 	} %>
		 	</span>
			<form action="UsuarioServlet" method="post" onsubmit="return validaUsuario(this)">
				<table>				
					<tr>
						<td>Login:<span class="warningsSpam">*</span></td>
						<td><input type="text" name="login" id="login"
							value="<%=usuarioDTO.getLogin() != null ? usuarioDTO.getLogin() : ""%>">
						</td>
					</tr>
					<tr>
						<td>Senha:<span class="warningsSpam">*</span></td>
						<td><input type="password" name="senha" id="senha"
							value="<%=usuarioDTO.getSenha() != null ? usuarioDTO.getSenha() : ""%>">
						</td>
					</tr>
				</table>
				<button type="submit" name="acao" id="acao" value="Incluir" class="botao">Incluir</button>
			</form>
			<form action="UsuarioServlet" method="post">
				<button type="submit" name="acao" id="acao" value="Cancelar" class="botao">Cancelar</button>
			</form>
		</div>
		
		<jsp:include page="../include/destaqueAutores.jsp"></jsp:include>
	</div>
</body>
</html>